package com.xjy.rpc.netty;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;

public class ByteBufTest {

    public static void main(String[] args) {
        ByteBuf byteBuf = ByteBufAllocator.DEFAULT.heapBuffer(256);
        int readIndex = byteBuf.readerIndex();
        byte[] bytes = new byte[1024];
        int fip = byteBuf.readerIndex();
        while (fip < bytes.length){
            byteBuf.readBytes(bytes,fip,byteBuf.capacity());
            fip = byteBuf.readerIndex();
        }

        System.out.printf("123");

    }
}
